package com.inibb.app.constant;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import com.inibb.app.util.lang.StringUtil;




public class SecurityConstant {

	public static final String ANOYMOUS_USER_EXTERNAL = "ANONY";
	public static final String CSC_SUPERVISOR_ATTRIBUTE = "supervisor";
	public static final String LBCP_SITE_ATTRIBUTE = "site";
	public static final String TEAM_ATTRIBUTE = "team";
	public static final String ROLE_ATTRIBUTE = "role";
	public static final String ROLE_GROUP_ATTRIBUTE = "rolegroup";
	public static final String REGT_CENTER_ATTRIBUTE = "regtCtr";
	public static final Map<String, String> SECURITY_ERROR_CODE_MAPPING = new HashMap<String, String>();
	public static final Map<String, String> VERIFY_ERROR_CODE_MAPPING = SECURITY_ERROR_CODE_MAPPING;
	static{

		for(int i=1;i<=19;i++){
			/**
			 * Example : 0001: ROC-E-8001
			 */
			String key = "0"+StringUtil.addLeadingZero(String.valueOf(i), 3);
			String value = "ROC-E-80" + StringUtil.addLeadingZero(String.valueOf(i), 2);
			SECURITY_ERROR_CODE_MAPPING.put(key, value);
		}
		
		
		for(int i=4;i<=13;i++){
			/**
			 * Example : 1004: ROC-E-8104
			 */
			String key = "1"+StringUtil.addLeadingZero(String.valueOf(i), 3);
			String value = "ROC-E-81" + StringUtil.addLeadingZero(String.valueOf(i), 2);
			SECURITY_ERROR_CODE_MAPPING.put(key, value);
		}

		for(int i=1;i<=13;i++){
			/**
			 * Example : 3001: ROC-E-8301
			 */
			String key = "3"+StringUtil.addLeadingZero(String.valueOf(i), 3);
			String value = "ROC-E-83" + StringUtil.addLeadingZero(String.valueOf(i), 2);
			SECURITY_ERROR_CODE_MAPPING.put(key, value);
		}
		
		
		//error code for cert verification
		for(int i=0;i<=40;i++){
			/**
			 * Example : 1: ROC-E-7001
			 */
			SECURITY_ERROR_CODE_MAPPING.put(String.valueOf(i), "ROC-E-"+(7000+i));
		}

	}

	public static void main(String[] args){
		Iterator iter = SECURITY_ERROR_CODE_MAPPING.entrySet().iterator();
		while(iter.hasNext()){
			System.out.println(iter.next());
		}
	}

	
}

